Carbon


GetComponentRefcon

Header: Components.h Carbon status: Supported

Retrieves the value of the reference constant for your component.

SInt32 GetComponentRefcon (
    Component aComponent
);
Parameter descriptions
aComponent

The component whose reference constant you wish to get. You can use a component instance here, but you must coerce the data type appropriately.

function result

The reference constant for the specified component.

DISCUSSION

There is one reference constant for each component, regardless of the number of connections to that component. When your component is registered, the Component Manager sets this reference constant to 0.

The reference constant is a 4-byte value that your component can use in any way you decide. For example, you might use the reference constant to store the address of a data structure that is shared by all connections maintained by your component. You should allocate shared structures in the system heap. Your component should deallocate the structure when its last connection is closed or when it is unregistered.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)